<?php
/**
 * Created by PhpStorm.
 * User: hhcyc
 * Date: 2018/4/4
 * Time: 23:14
 */


//Swoole\Async::writeFile(string $filename, string $fileContent, callable $callback = null, int $flags = 0)

/**
 * swoole_async_write 大文件写
 */
$file_content = date("Y-m-d H:i:s").PHP_EOL;

swoole_async_writefile(__DIR__.'/1.log', $file_content, function($filename) {
    echo "wirte ok {$filename}.\n";
}, FILE_APPEND);

echo "start".PHP_EOL;